﻿package mortal.game.view.copy.wine
{
    import Message.BroadCast.*;
    import Message.DB.Tables.*;
    import Message.Public.*;
    import com.gengine.core.frame.*;
    import com.gengine.global.*;
    import com.gengine.utils.*;
    import com.mui.utils.*;
    import extend.language.*;
    import flash.events.*;
    import flash.geom.*;
    import flash.utils.*;
    import mortal.component.gconst.*;
    import mortal.component.window.*;
    import mortal.game.*;
    import mortal.game.cache.*;
    import mortal.game.events.*;
    import mortal.game.manager.*;
    import mortal.game.mvc.*;
    import mortal.game.resource.info.*;
    import mortal.game.resource.tableConfig.*;
    import mortal.game.rules.*;
    import mortal.game.scene3D.ai.*;
    import mortal.game.scene3D.display3d.text3d.staticText3d.*;
    import mortal.game.scene3D.display3d.text3d.staticText3d.action.*;
    import mortal.game.scene3D.layer3D.utils.*;
    import mortal.game.scene3D.map3D.util.*;
    import mortal.game.scene3D.player.entity.*;
    import mortal.game.scene3D.player.info.*;
    import mortal.game.utils.*;
    import mortal.game.view.common.*;
    import mortal.game.view.common.cd.*;
    import mortal.game.view.copy.*;
    import mortal.game.view.copy.wine.util.*;
    import mortal.game.view.copy.wine.view.*;
    import mortal.game.view.guide.*;
    import mortal.game.view.mainUI.roleAvatar.*;
    import mortal.game.view.task.drama.operations.*;
    import mortal.mvc.core.*;
    import mortal.mvc.interfaces.*;

    public class WinePartyCopyController extends CopyControllerBase
    {
        private var _winePartyWin:WinePartyMainWin;
        private var _isWinePartyOpen:Boolean;
        private var _isWinePartyClose:Boolean;
        private var _isWinePartyBegin:Boolean;
        private var _isWinePartyEnd:Boolean;
        private var _isInMora:Boolean;
        private var _isStartMora:Boolean;
        private var _isDirection:Boolean;
        private var _isToaster:Boolean;
        private var _timer1:SecTimer;
        private var _timer2:SecTimer;
        private var _timer3:SecTimer;
        private var _timer4:SecTimer;
        private var _tieNum:int;
        private var _currSelWine:int;
        private var _isServerMora:Boolean = false;
        private var _timeId:int;
        private var _moraEntityInfo:SEntityInfo;
        private var _toaster:UserPlayer;
        private var _leftTimeView:LeftTimeView;

        public function WinePartyCopyController()
        {
            return;
        }// end function

        override protected function initServer() : void
        {
            NetDispatcher.addCmdListener(ServerCommand.GuildWinePartyOpen, this.onGuilWinePartyOpen);
            NetDispatcher.addCmdListener(ServerCommand.GuildWinePartyEnd, this.onGuilWinePartyEnd);
            NetDispatcher.addCmdListener(ServerCommand.BufferUpdate, this.onAddDrunkBuff);
            NetDispatcher.addCmdListener(ServerCommand.WinePartyMoraUpdate, this.onWinePartyMoraUpdate);
            Dispatcher.addEventListener(EventName.WinePartyCollectEnd, this.onWineCollectEnd);
            Dispatcher.addEventListener(EventName.WinePartyStartToast, this.onStartToastHandler);
            Dispatcher.addEventListener(EventName.WinePartyEnterCopy, this.onEnterWineCopy);
            Dispatcher.addEventListener(EventName.WinePartySendMoraType, this.onSendMoraTypeHandler);
            NetDispatcher.addCmdListener(ServerCommand.WinePartyDetailRankUpdate, this.onRankInfoUpdate);
            Dispatcher.addEventListener(EventName.WinePartyOpenEnterWin, this.onOpenWinePartyEnterWin);
            Cache.instance.role.roleEntityInfo.addEventListener(EntityInfoEventName.UpdateStatus, this.onUpdateEntityStatus);
            return;
        }// end function

        override protected function initView() : IView
        {
            if (this._winePartyWin == null)
            {
                this._winePartyWin = new WinePartyMainWin();
                this._winePartyWin.addEventListener(WindowEvent.SHOW, this.onWinShow);
                this._winePartyWin.addEventListener(WindowEvent.CLOSE, this.onWinClose);
            }
            return this._winePartyWin;
        }// end function

        private function onWinShow(event:Event) : void
        {
            return;
        }// end function

        private function onWinClose(event:Event) : void
        {
            return;
        }// end function

        private function resetAllState() : void
        {
            this._isInMora = false;
            this._isDirection = false;
            this.isStartMora = false;
            this._isToaster = false;
            this._isServerMora = false;
            return;
        }// end function

        private function onGuilWinePartyOpen(param1:Object) : void
        {
            this._isWinePartyOpen = true;
            Dispatcher.dispatchEvent(new DataEvent(EventName.WinePartyBtnStateUpdate));
            if (!this._winePartyWin || this._winePartyWin && this._winePartyWin.isHide)
            {
                if (!GameMapUtil.curMapState.isWineMap)
                {
                    WinePartyOpenIcon.instance.show();
                }
            }
            return;
        }// end function

        private function onGuilWinePartyEnd(param1:Object) : void
        {
            if (GameMapUtil.curMapState.isWineMap)
            {
                this._isWinePartyOpen = false;
                Dispatcher.dispatchEvent(new DataEvent(EventName.WinePartyBtnStateUpdate));
                WinePartyResultWin.instance.show();
                if (!WinePartyOpenIcon.instance.isHide)
                {
                    WinePartyOpenIcon.instance.hide();
                }
            }
            return;
        }// end function

        override public function enterCopy(param1:TCopy) : void
        {
            super.enterCopy(param1);
            WinePartyDetailWin.instance.show();
            WinePartyBtnBar.instance.show();
            Dispatcher.dispatchEvent(new DataEvent(EventName.TaskShowHideTrackExceptBtn, false));
            cache.skill.needDisableUseSkill = true;
            cache.copy.wineParty.currCollectWineBoss = BossConfig.instance.getInfoByCode(GameConst.WinePartyOriginWineBossCode);
            if (this._winePartyWin && !this._winePartyWin.isHide)
            {
                this._winePartyWin.hide();
            }
            if (!WinePartyOpenIcon.instance.isHide)
            {
                WinePartyOpenIcon.instance.hide();
            }
            return;
        }// end function

        override public function leaveCopy() : void
        {
            super.leaveCopy();
            RolePlayer.instance.removeWineLife();
            WinePartyDetailWin.instance.hide();
            WinePartyBtnBar.instance.hide();
            WinePartyResultWin.instance.hide();
            if (!WinePartyMoraWin.instance.isHide)
            {
                WinePartyMoraWin.instance.hide();
            }
            cache.copy.wineParty.clearWineCollectState();
            cache.skill.needDisableUseSkill = false;
            cache.copy.wineParty.currCollectWineBoss = null;
            TaskDramaMouseKeyboardControl.enablePlayerOp = true;
            this.resetAllState();
            return;
        }// end function

        private function onSelectPersonOrNot(event:DataEvent) : void
        {
            var _loc_2:* = event.data as IEntity;
            if (_loc_2.type == EntityType.Player)
            {
                cache.copy.wineParty.updateCurrSelToaster(_loc_2.entityInfo.entityInfo);
            }
            return;
        }// end function

        private function onWineCollectEnd(event:DataEvent) : void
        {
            var _loc_2:* = event.data as BossInfo;
            if (GameMapUtil.curMapState.isWineMap)
            {
                cache.copy.wineParty.currCollectWineBoss = _loc_2;
                Dispatcher.dispatchEvent(new DataEvent(EventName.WinePartyWineCollectUpdate));
                MsgManager.showTaskTarget(Language.getStringByParam(41023, _loc_2.name), 3);
            }
            return;
        }// end function

        private function onStartToastHandler(event:DataEvent) : void
        {
            if (!this._isWinePartyOpen)
            {
                MsgManager.showRollTipsMsg(Language.getString(41024));
                return;
            }
            var _loc_2:* = ThingUtil.selectEntity as UserPlayer;
            if (_loc_2 == null)
            {
                MsgManager.showRollTipsMsg(Language.getString(41025));
                return;
            }
            if (cache.copy.wineParty.currCollectWineBoss.penetration == 10)
            {
                MsgManager.showRollTipsMsg(Language.getString(41026));
                return;
            }
            var _loc_3:* = cache.role.roleEntityInfo;
            if (!WinePartyUtil.isToastAvailable(_loc_3, _loc_2.entityInfo))
            {
                return;
            }
            this._currSelWine = event.data.wineType as int;
            if (this._timer4 == null)
            {
                this._timer4 = new SecTimer(1, 3);
                this._timer4.start();
                this.doToastAI();
            }
            if (this._timer4.running)
            {
                return;
            }
            this._timer4.reset();
            this._timer4.repeatCount = 3;
            this._timer4.start();
            this.doToastAI();
            return;
        }// end function

        private function doToastAI() : void
        {
            var _loc_3:Point = null;
            AIManager.cancelAll();
            Global.instance.removeEnterFrame(this.checkDistance);
            var _loc_1:* = ThingUtil.selectEntity as UserPlayer;
            var _loc_2:* = _loc_1.entityInfo.entityInfo.points[0];
            if (_loc_2)
            {
                _loc_3 = new Point(_loc_1.x2d, _loc_1.y2d);
                AIManager.onAIControl(AIType.GoToOtherMap, Game.mapInfo.mapId, Game.mapInfo.mapId, _loc_3);
            }
            Global.instance.addEnterFrame(this.checkDistance);
            return;
        }// end function

        private function checkDistance() : void
        {
            var _loc_1:* = ThingUtil.selectEntity as UserPlayer;
            if (_loc_1 == null)
            {
                AIManager.cancelAll();
                Global.instance.removeEnterFrame(this.checkDistance);
                return;
            }
            var _loc_2:* = new Point(RolePlayer.instance.x2d, RolePlayer.instance.y2d);
            var _loc_3:* = new Point(_loc_1.x, _loc_1.y2d);
            if (!AIManager.isWorking)
            {
                Global.instance.removeEnterFrame(this.checkDistance);
                return;
            }
            var _loc_4:* = int(Point.distance(_loc_2, _loc_3));
            if (_loc_4 <= 100)
            {
                AIManager.cancelAll();
                Global.instance.removeEnterFrame(this.checkDistance);
                this.startMora();
            }
            return;
        }// end function

        private function startMora() : void
        {
            if (this.isStartMora)
            {
                return;
            }
            var _loc_1:* = RolePlayer.instance;
            var _loc_2:* = ThingUtil.selectEntity as UserPlayer;
            GameProxy.guild.startMora(_loc_2.entityInfo.entityInfo.entityId);
            this.isStartMora = true;
            this._isToaster = true;
            this._timeId = setTimeout(this.clearTime, 500);
            return;
        }// end function

        private function clearTime() : void
        {
            var _loc_1:* = ThingUtil.selectEntity as UserPlayer;
            if (!this._isServerMora)
            {
                this.isStartMora = false;
            }
            else if (_loc_1)
            {
                MsgManager.showTaskTarget(Language.getStringByParam(41027, _loc_1.entityInfo.entityInfo.name), 5);
            }
            clearTimeout(this._timeId);
            return;
        }// end function

        private function onUpdateEntityStatus(event:Event) : void
        {
            var e:* = event;
            var roleEntityInfo:* = cache.role.roleEntityInfo;
            if (!GameMapUtil.curMapState.isWineMap)
            {
                return;
            }
            if (GameMapUtil.curMapState.isWineMap && Global.isDebugModle)
            {
                MsgManager.showRollTipsMsg(Language.getString(41028) + roleEntityInfo.entityInfo.status);
            }
            if (this._isInMora)
            {
                this.showMoraResult();
            }
            if (roleEntityInfo.entityInfo.status == EMoveStatus._EMoveStatusNormal)
            {
                this.isStartMora = false;
                this._isServerMora = false;
                this._isDirection = false;
            }
            if (roleEntityInfo.entityInfo.status == EMoveStatus._EMoveStatusMoraReady)
            {
                this._isInMora = true;
                this.isStartMora = true;
                this._isServerMora = true;
                if (WinePartyMoraWin.instance.isHide && GameMapUtil.curMapState.isWineMap)
                {
                    WinePartyMoraWin.instance.show();
                }
            }
            else if (roleEntityInfo.isInMora)
            {
                var onTimeCompl:* = function (param1:SecTimer) : void
            {
                _timer3.stop();
                onEndMora();
                return;
            }// end function
            ;
                AIManager.cancelAll();
                if (!WinePartyMoraWin.instance.isHide)
                {
                    WinePartyMoraWin.instance.hide();
                }
                if (!this._isDirection)
                {
                    this.directionHandler();
                }
                if (this._timer3 == null)
                {
                    this._timer3 = new SecTimer(1, 5);
                }
                else
                {
                    this._timer3.reset();
                    this._timer3.repeatCount = 5;
                }
                this._timer3.start();
                this._timer3.addListener(TimerType.COMPLETE, onTimeCompl);
            }
            if (roleEntityInfo.isInToast)
            {
                var onTimeCompl2:* = function (param1:SecTimer) : void
            {
                _timer1.stop();
                onToastEnd();
                return;
            }// end function
            ;
                if (this._timer1 == null)
                {
                    this._timer1 = new SecTimer(1, 5);
                }
                else
                {
                    this._timer1.reset();
                    this._timer1.repeatCount = 5;
                }
                this._timer1.start();
                this._timer1.addListener(TimerType.COMPLETE, onTimeCompl2);
            }
            if (GameMapUtil.curMapState.isWineMap && (roleEntityInfo.isInMora || roleEntityInfo.isInToast || roleEntityInfo.isInDrunk))
            {
                AIManager.cancelAll();
            }
            return;
        }// end function

        private function onSendMoraTypeHandler(event:DataEvent) : void
        {
            var _loc_3:SEntityId = null;
            var _loc_4:int = 0;
            var _loc_2:* = event.data as int;
            if (this._moraEntityInfo)
            {
                _loc_3 = this._moraEntityInfo.entityId;
                _loc_4 = cache.copy.wineParty.currCollectWineBoss.penetration;
                GameProxy.guild.showMora(_loc_3, _loc_2, _loc_4);
            }
            return;
        }// end function

        private function onEndMora() : void
        {
            var _loc_1:SEntityId = null;
            if (this._moraEntityInfo)
            {
                _loc_1 = this._moraEntityInfo.entityId;
                GameProxy.guild.endMora(_loc_1);
                this._isDirection = false;
            }
            return;
        }// end function

        private function showMoraResult() : void
        {
            var otherEntityInfo:SEntityInfo;
            var id:int;
            var selfEntityInfo:* = cache.role.roleEntityInfo.entityInfo;
            var otherEntity:* = ThingUtil.entityUtil.getEntity(this._moraEntityInfo.entityId);
            if (otherEntity)
            {
                otherEntityInfo = otherEntity.entityInfo.entityInfo;
            }
            if (selfEntityInfo.entityId.id == this._moraEntityInfo.ownerEntityId.id)
            {
                if (selfEntityInfo.status == EMoveStatus._EMoveStatusMoraReady)
                {
                    this._isToaster = false;
                    MsgManager.showTaskTarget(Language.getString(41029), 3);
                    var _loc_2:String = this;
                    var _loc_3:* = this._tieNum + 1;
                    _loc_2._tieNum = _loc_3;
                }
                else if (selfEntityInfo.status == EMoveStatus._EMoveStatusNormal)
                {
                    this._isInMora = false;
                    this._isToaster = false;
                    MsgManager.showTaskTarget(Language.getString(41030), 3);
                    this.addExpGainEffect();
                    cache.copy.wineParty.currCollectWineBoss = BossConfig.instance.getInfoByCode(GameConst.WinePartyOriginWineBossCode);
                    Dispatcher.dispatchEvent(new DataEvent(EventName.WinePartyWineCollectUpdate));
                    this._tieNum = 0;
                }
                else if (selfEntityInfo.status == EMoveStatus._EMoveStatusGuildToast && otherEntityInfo)
                {
                    var onTimeOut:* = function () : void
            {
                _isInMora = false;
                _isToaster = false;
                if (otherEntityInfo.status == EMoveStatus._EMoveStatusGuildToast)
                {
                    MsgManager.showTaskTarget(Language.getString(41031), 3);
                    cache.copy.wineParty.currCollectWineBoss = BossConfig.instance.getInfoByCode(GameConst.WinePartyOriginWineBossCode);
                    Dispatcher.dispatchEvent(new DataEvent(EventName.WinePartyWineCollectUpdate));
                }
                else
                {
                    MsgManager.showTaskTarget(Language.getString(41032), 3);
                }
                clearTimeout(id);
                return;
            }// end function
            ;
                    id = setTimeout(onTimeOut, 500);
                }
            }
            return;
        }// end function

        private function onWinePartyMoraUpdate(param1:Object) : void
        {
            var _loc_4:UserPlayer = null;
            var _loc_5:UserPlayer = null;
            var _loc_6:UserPlayer = null;
            var _loc_2:* = param1 as SEntityInfo;
            var _loc_3:* = cache.role.roleEntityInfo.entityInfo;
            if (_loc_2.ownerEntityId.id == cache.role.roleEntityInfo.entityInfo.entityId.id)
            {
                this._moraEntityInfo = _loc_2;
                if (!this._isToaster)
                {
                    _loc_4 = ThingUtil.entityUtil.getEntity(_loc_2.entityId) as UserPlayer;
                    MsgManager.showTaskTarget(Language.getStringByParam(41033, _loc_4.entityInfo.entityInfo.name), 5);
                }
            }
            if (_loc_2)
            {
                _loc_5 = ThingUtil.entityUtil.getEntity(_loc_2.entityId) as UserPlayer;
                _loc_6 = ThingUtil.entityUtil.getEntity(_loc_2.ownerEntityId) as UserPlayer;
                if (_loc_5 && _loc_6)
                {
                    _loc_5.direction = MathUitl.getAngleByXY(_loc_5.x2d, _loc_5.y2d, _loc_6.x2d, _loc_6.y2d);
                    _loc_6.direction = MathUitl.getAngleByXY(_loc_6.x2d, _loc_6.y2d, _loc_5.x2d, _loc_5.y2d);
                }
            }
            return;
        }// end function

        private function directionHandler() : void
        {
            var _loc_1:UserPlayer = null;
            var _loc_2:UserPlayer = null;
            if (this._moraEntityInfo)
            {
                this._isDirection = true;
                _loc_1 = ThingUtil.entityUtil.getEntity(this._moraEntityInfo.entityId) as UserPlayer;
                _loc_2 = ThingUtil.entityUtil.getEntity(this._moraEntityInfo.ownerEntityId) as UserPlayer;
                if (_loc_1 && _loc_2)
                {
                    _loc_1.direction = MathUitl.getAngleByXY(_loc_1.x2d, _loc_1.y2d, _loc_2.x2d, _loc_2.y2d);
                    _loc_2.direction = MathUitl.getAngleByXY(_loc_2.x2d, _loc_2.y2d, _loc_1.x2d, _loc_1.y2d);
                }
            }
            return;
        }// end function

        private function addOperateLimit() : void
        {
            TaskDramaMouseKeyboardControl.enablePlayerOp = false;
            AIManager.cancelAll();
            RolePlayer.instance.stopMove();
            GameMapUtil.isCanMoveOnClickMap = false;
            return;
        }// end function

        private function removeOperateLimit() : void
        {
            TaskDramaMouseKeyboardControl.enablePlayerOp = true;
            GameMapUtil.isCanMoveOnClickMap = true;
            return;
        }// end function

        private function onToastSuccHandler() : void
        {
            var onTimeCompl:Function;
            var onEnterFrame:Function;
            onTimeCompl = function (param1:SecTimer) : void
            {
                _timer1.stop();
                onSelfToastEnd();
                afterSelfToastEnd();
                return;
            }// end function
            ;
            onEnterFrame = function (param1:SecTimer) : void
            {
                var _loc_2:* = ThingUtil.selectEntity as UserPlayer;
                if (!(_loc_2 && _loc_2.entityInfo))
                {
                    _timer1.stop();
                    cache.copy.wineParty.currToastingPlayer = null;
                    _toaster = null;
                    cache.copy.wineParty.updateWineCollectState(_currSelWine, true);
                    Dispatcher.dispatchEvent(new DataEvent(EventName.WinePartyWineCollectUpdate));
                    MsgManager.removeTaskTarget();
                }
                return;
            }// end function
            ;
            cache.copy.wineParty.updateWineCollectState(this._currSelWine, false);
            Dispatcher.dispatchEvent(new DataEvent(EventName.WinePartyWineCollectUpdate));
            this._toaster = RolePlayer.instance;
            var toBeToaster:* = cache.copy.wineParty.currToastingPlayer;
            MsgManager.showTaskTarget(Language.getStringByParam(41034, toBeToaster.entityInfo.entityInfo.name), 0);
            if (this._timer1 == null)
            {
                this._timer1 = new SecTimer(1, 10);
            }
            else
            {
                this._timer1.reset();
                this._timer1.repeatCount = 10;
            }
            this._timer1.start();
            this._timer1.addListener(TimerType.COMPLETE, onTimeCompl);
            this._timer1.addListener(TimerType.ENTERFRAME, onEnterFrame);
            return;
        }// end function

        private function onSelfToastEnd() : void
        {
            var _loc_1:* = cache.copy.wineParty.currToastingPlayer;
            var _loc_2:* = WinePartyUtil.getBuffIdByWineType(this._currSelWine);
            if (_loc_1 && _loc_1.entityInfo)
            {
                GameProxy.guild.winePartyToastEnd(_loc_1.entityInfo.entityInfo.entityId, _loc_2);
                MsgManager.removeTaskTarget();
                MsgManager.showRollTipsMsg(Language.getString(41035));
            }
            return;
        }// end function

        private function onToastEnd() : void
        {
            if (this._moraEntityInfo)
            {
                GameProxy.guild.winePartyToastEnd(this._moraEntityInfo.entityId);
                MsgManager.showRollTipsMsg(Language.getString(41035));
            }
            return;
        }// end function

        private function afterSelfToastEnd() : void
        {
            cache.copy.wineParty.currToastingPlayer = null;
            this._toaster = null;
            this.addExpGainEffect();
            return;
        }// end function

        private function addExpGainEffect() : void
        {
            var _loc_1:* = WinePartyDetailWin.instance.localToGlobal(new Point(0, 0));
            _loc_1.x = _loc_1.x + 120;
            _loc_1.y = _loc_1.y + 88;
            GuideEffect.playAddExpEffect(10000, _loc_1.x, _loc_1.y);
            return;
        }// end function

        private function addDrunkSceneText(param1:int) : void
        {
            var _loc_2:LeftTimeView = null;
            if (this._leftTimeView == null)
            {
                _loc_2 = UICompomentPool.getUICompoment(LeftTimeView);
                _loc_2.setSceneTextStyle();
            }
            _loc_2.setParse(Language.getString(41036));
            _loc_2.updateLeftTime(param1);
            _loc_2.show();
            _loc_2.setBottomPosition();
            return;
        }// end function

        private function onAddDrunkBuff(param1:Object) : void
        {
            var _loc_3:BuffData = null;
            var _loc_4:CDData = null;
            var _loc_2:* = param1 as Array;
            if (_loc_2 && GameMapUtil.curMapState.isWineMap)
            {
                for each (_loc_3 in _loc_2)
                {
                    
                    if (_loc_3.tbuff.symbol == GameConst.TGuildWineDrunkBuffSymbol)
                    {
                        _loc_4 = Cache.instance.cd.getCDData(_loc_3.tbuff.buffId, CDDataType.backPackLock) as CDData;
                        this.addDrunkSceneText(_loc_4.leftTime * 0.001);
                    }
                }
            }
            return;
        }// end function

        private function onEnterWineCopy(event:DataEvent) : void
        {
            if (RolePlayer.instance.entityInfo.isDead)
            {
                MsgManager.showRollTipsMsg(Language.getString(41037));
                return;
            }
            CopyUtil.copyCheck(this.enterWinePartyCopy);
            return;
        }// end function

        private function enterWinePartyCopy() : void
        {
            GameProxy.copy.enterWinePartyCopy();
            return;
        }// end function

        private function onRankInfoUpdate(param1:Object) : void
        {
            var _loc_3:int = 0;
            var _loc_4:TZazenRewardConfig = null;
            var _loc_5:int = 0;
            var _loc_6:int = 0;
            var _loc_2:* = Cache.instance.copy.wineParty.winePartyDetailInfo;
            if (_loc_2.updateType == 1)
            {
                _loc_3 = cache.role.entityInfo.level;
                _loc_4 = ZazenRewardConfig.instance.getInfoById(_loc_3);
                if (_loc_4)
                {
                    _loc_5 = _loc_4.wineOnlineExp;
                    this.flyText(Language.getString(41038), _loc_5);
                }
                _loc_6 = GameConst.WinePartyOnlineDonateReward;
                this.flyText(Language.getString(41039), _loc_6);
            }
            return;
        }// end function

        private function flyText(param1:String, param2:int) : void
        {
            var _loc_5:String = null;
            var _loc_3:* = new ActionVo();
            _loc_3.reInit(2, 0, 0, 0, 0, false, false);
            var _loc_4:* = RolePlayer.hasInstacne() && RolePlayer.instance.bodyPlayer;
            if (_loc_4)
            {
                _loc_5 = param1 + "+" + param2;
                SText3DFactory.instance.createtext3D(_loc_5, 0, RolePlayer.instance.bodyPlayer, _loc_3);
            }
            return;
        }// end function

        private function onOpenWinePartyEnterWin(event:DataEvent) : void
        {
            view.show();
            return;
        }// end function

        public function get isWinePartyOpen() : Boolean
        {
            return this._isWinePartyOpen;
        }// end function

        public function get isInMora() : Boolean
        {
            return this._isInMora || this.isStartMora;
        }// end function

        public function get isStartMora() : Boolean
        {
            return this._isStartMora;
        }// end function

        public function set isStartMora(param1:Boolean) : void
        {
            this._isStartMora = param1;
            if (this._isStartMora)
            {
                this.addOperateLimit();
            }
            else
            {
                this.removeOperateLimit();
            }
            return;
        }// end function

    }
}
